module.exports = {
    configureWebpack: {
        devServer: {
            before(app) {
                app.get('/api/v1/types',(request,response)=>{
                    response.json({
                        types: [{
                            "id": "1",
                            "text": "汤类"
                        },
                        {
                            "id": "2",
                            "text": "折扣"
                        },
                        {
                            "id": "3",
                            "text": "热卖"
                        },
                        {
                            "id": "4",
                            "text": "特色菜"
                        },
                        {
                            "id": "5",
                            "text": "冷饮"
                        }
                    ]
                    });
                });
                app.get('/api/v1/products', (req, resp) => {
                    resp.json({
                        result: 'ok',
                        products: [{
                                "id": 1,
                                "typeId": "3",
                                "imageUrl": "../../images/products/mxr.jpg",
                                "name": "木须肉",
                                "price": 36,
                                "real": 27,
                                "number": 30,
                                "count": 0,
                                "good": 5,
                                "selected": false,
                                "trait": "鲁菜、家常菜、鲜香美味",
                                "detail": "原名木樨肉，是 一道常见的特色传统名菜，属八大菜系之一的鲁菜-孔府菜，俗语常读作为木须肉、苜蓿肉等。其菜以猪肉片与鸡蛋、木耳等混炒而成， 因炒鸡蛋色黄而碎，类似木樨而得名。"
                            },
                            {
                                "id": 2,
                                "typeId": "4",
                                "imageUrl": "../../images/products/kyt.jpg",
                                "name": "烤羊腿",
                                "price": 340,
                                "real": 210,
                                "number": 10,
                                "count": 0,
                                "good": 4,
                                "selected": false,
                                "trait": "硬菜、宴席主菜",
                                "detail": "烤羊腿是一道菜品，制作原料主要有羊后腿、番茄酱、芹菜等。烤羊腿是呼伦贝尔招待宾客的一道佳肴名菜。烤羊腿是从烤全羊演变而来。"
                            },
                            {
                                "id": 3,
                                "typeId": "4",
                                "imageUrl": "../../images/products/jzdc.jpg",
                                "name": "九转大肠",
                                "price": 65,
                                "real": 54,
                                "number": 13,
                                "count": 0,
                                "good": 4,
                                "selected": false,
                                "trait": "鲁菜、传统名吃",
                                "detail": "九转大肠"
                            },
                            {
                                "id": 4,
                                "typeId": "5",
                                "imageUrl": "../../images/products/sd.jpg",
                                "name": "圣代",
                                "price": 9,
                                "real": 6,
                                "number": 59,
                                "count": 0,
                                "good": 2,
                                "selected": false,
                                "trait": "甜点",
                                "detail": "圣代"
                            }
                        ]
                    })
                });
            }
        }
    }
}